package com.liruo.enumconverter.nogeneric.deserialize;

import com.liruo.enumconverter.model.SourceEnum;
import org.springframework.core.convert.converter.Converter;

/**
 * @Author:liruo
 * @Date:2023-02-19-13:46:59
 * @Desc
 * 注意传参是class要对应Converter的第二个泛型，这个实在没办法用泛型规范
 * 必须指定什么类型由什么类型来转换 即不能泛型化--参数化
 */
public class StrSourceToEnumConverterFactory extends AbstractSourceToEnumConverterFactory<String> {
    public StrSourceToEnumConverterFactory() {
        super(String.class);
    }
    @Override
    public <T extends SourceEnum<String>> Converter<String, T> getConverter(Class<T> targetType) {
        return super.getConverterBySource(targetType);
    }
}
